/* *****************************************************************************************************
 * Copyright 2009. Dbwebx Group
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 * *****************************************************************************************************
 */

package org.dbwebx.service.dao;

import java.util.List;

import org.dbwebx.domain.User;

/**
 * The service interface for {@link User} entities management.
 * 
 * @author Izzet_Mustafayev
 */
public interface UserService {
	/**
	 * Lists available {@link User}s from persistence storage.
	 * 
	 * @return the {@link User} list
	 */
	List<User> list();

	/**
	 * Persists {@link User} to the persistence storage.
	 * 
	 * @param user
	 *            the {@link User} to persist
	 */
	void persist(User user);

	/**
	 * Loads {@link User} by given identity
	 * 
	 * @param userId
	 *            the {@link User} identity to load
	 * @return found {@link User}
	 */
	User load(Long userId);

	/**
	 * Searches {@link User} by given login name.
	 * 
	 * @param login
	 *            the {@link User} login name to find
	 * @return found {@link User}
	 */
	User find(String login);
}
